Skip to content

fix: bound the number of entries in a compression table advertisement (#3510) - #3521

Merged
pjfanning merged 1 commit into
apache:1.7.xfrom
pjfanning:table17
Sep 4, 2026
Merged

fix: bound the number of entries in a compression table advertisement (#3510)#3521
pjfanning merged 1 commit into
apache:1.7.xfrom
pjfanning:table17

Conversation

@pjfanning

Copy link
Copy Markdown
Member

Motivation

Backport of #3510 to 1.7.x: a compression table advertisement carried an unbounded number
of entries, each of which is resolved on the inbound control stream — for actor refs that
means parsing a path and populating the resolve cache — bounded only by the frame size.

Modification

Cherry-pick of 6751ab9. Conflicts were confined to import blocks in
ArteryMessageSerializer (1.7.x also imports Flush/FlushAck there) and its spec
(adding ArteryControlFormats to an existing import); the change itself applied clean.

Result

Same as #3510: an advertisement carrying more entries than the receiver's configured
pekko.remote.artery.advanced.compression.<table>.max is rejected as a serialization
failure; a legitimately sized one is unaffected, and no bound is applied when compression
is off locally.

Tests

  • sbt "++ 2.12.21 remote/Test/compile" — clean, validating Scala 2.12
  • scalafmt clean on the cherry-picked files (the one flagged file is pre-existing
    formatting drift in NestedPayloadDepthSpec on 1.7.x, left untouched)
  • Test suites intentionally left to CI per the release-prep flow; the boundary test from
    fix: bound the number of entries in a compression table advertisement #3510 (exactly max accepted, max + 1 rejected) is included

References

Backport of #3510.

…apache#3510)

Motivation:
deserializeCompressionAdvertisement resolves every key in the advertised
table, and for actor refs that means parsing a path and populating the
resolve cache. The key list was unbounded, so the only limit was the
transport frame size. Measured, 10000 entries is 369 KB of wire and about
150 ms of CPU on the inbound control stream, against 9 KB for the 256
entry table a peer legitimately advertises.

Modification:
Reject an advertisement carrying more entries than
pekko.remote.artery.advanced.compression.<table>.max, the setting that
bounds the table on the sending side and is normally the same across a
cluster. When it is "off" locally there is no number to check against and
no bound is applied.

Result:
An oversized advertisement is reported as a serialization failure, which
the inbound stream logs and drops. Advertisements are resent periodically,
so a dropped one costs at most a delay in establishing compression.
@pjfanning pjfanning added this to the 1.7.1 milestone Sep 3, 2026
@pjfanning
pjfanning merged commit f2b7bdb into apache:1.7.x Sep 4, 2026
10 checks passed
@pjfanning
pjfanning deleted the table17 branch September 4, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants